/*
Copyright (c) [2022] [shawnping]
[masm-assistant] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2. 
You may obtain a copy of Mulan PSL v2 at:
         http://license.coscl.org.cn/MulanPSL2 
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
See the Mulan PSL v2 for more details.
*/

/*                ███╗   ███╗ █████╗ ███████╗███╗   ███╗                    */
/*                ████╗ ████║██╔══██╗██╔════╝████╗ ████║                    */
/*                ██╔████╔██║███████║███████╗██╔████╔██║                    */
/*                ██║╚██╔╝██║██╔══██║╚════██║██║╚██╔╝██║                    */
/*                ██║ ╚═╝ ██║██║  ██║███████║██║ ╚═╝ ██║                    */
/*                ╚═╝     ╚═╝╚═╝  ╚═╝╚══════╝╚═╝     ╚═╝                    */
/*                                                                          */
/*   █████╗ ███████╗███████╗██╗███████╗████████╗ █████╗ ███╗   ██╗████████╗ */
/*  ██╔══██╗██╔════╝██╔════╝██║██╔════╝╚══██╔══╝██╔══██╗████╗  ██║╚══██╔══╝ */
/*  ███████║███████╗███████╗██║███████╗   ██║   ███████║██╔██╗ ██║   ██║    */
/*  ██╔══██║╚════██║╚════██║██║╚════██║   ██║   ██╔══██║██║╚██╗██║   ██║    */
/*  ██║  ██║███████║███████║██║███████║   ██║   ██║  ██║██║ ╚████║   ██║    */
/*  ╚═╝  ╚═╝╚══════╝╚══════╝╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝    */

/* eslint-disable @typescript-eslint/naming-convention */

import { IReservedWord, IReservedWordGroup } from '../Base/baseInterfaceFile';

export const register_Byte: IReservedWord[] = [
    { word: 'ah', brief: '8-bit general-purpose register.' },
    { word: 'bh', brief: '8-bit general-purpose register.' },
    { word: 'ch', brief: '8-bit general-purpose register.' },
    { word: 'dh', brief: '8-bit general-purpose register.' },
    { word: 'al', brief: '8-bit general-purpose register.' },
    { word: 'bl', brief: '8-bit general-purpose register.' },
    { word: 'cl', brief: '8-bit general-purpose register.' },
    { word: 'dl', brief: '8-bit general-purpose register.' },
    { word: 'dil', brief: '8-bit segment register.' },
    { word: 'sil', brief: '8-bit segment register.' },
    { word: 'bpl', brief: '8-bit segment register.' },
    { word: 'spl', brief: '8-bit segment register.' },
    { word: 'r8b', brief: '8-bit general-purpose register.' },
    { word: 'r9b', brief: '8-bit general-purpose register.' },
    { word: 'r10b', brief: '8-bit general-purpose register.' },
    { word: 'r11b', brief: '8-bit general-purpose register.' },
    { word: 'r12b', brief: '8-bit general-purpose register.' },
    { word: 'r13b', brief: '8-bit general-purpose register.' },
    { word: 'r14b', brief: '8-bit general-purpose register.' },
    { word: 'r15b', brief: '8-bit general-purpose register.' },
];

export const register_GP_16: IReservedWord[] = [
    { word: 'ax' },
    { word: 'bx' },
    { word: 'cx' },
    { word: 'dx' },
    { word: 'di' },
    { word: 'si' },
    { word: 'bp' },
    { word: 'sp' },
    { word: 'r8w' },
    { word: 'r9w' },
    { word: 'r10w' },
    { word: 'r11w' },
    { word: 'r12w' },
    { word: 'r13w' },
    { word: 'r14w' },
    { word: 'r15w' },
];
export const register_GP_32: IReservedWord[] = [
    { word: 'eax' },
    { word: 'ebx' },
    { word: 'ecx' },
    { word: 'edx' },
    { word: 'edi' },
    { word: 'esi' },
    { word: 'ebp' },
    { word: 'esp' },
    { word: 'r8d' },
    { word: 'r9d' },
    { word: 'r10d' },
    { word: 'r11d' },
    { word: 'r12d' },
    { word: 'r13d' },
    { word: 'r14d' },
    { word: 'r15d' },
];


export const register_Qword: IReservedWord[] = [
    { word: 'rax' },
    { word: 'rbx' },
    { word: 'rcx' },
    { word: 'rdx' },
    { word: 'rdi' },
    { word: 'rsi' },
    { word: 'rbp' },
    { word: 'rsp' },
    { word: 'r8' },
    { word: 'r9' },
    { word: 'r10' },
    { word: 'r11' },
    { word: 'r12' },
    { word: 'r13' },
    { word: 'r14' },
    { word: 'r15' },
];

export const register_Segment: IReservedWord[] = [
    { word: 'cs' },
    { word: 'ds' },
    { word: 'ss' },
    { word: 'es' },
    { word: 'fs' },
    { word: 'gs' },
];

export const register_MMX: IReservedWord[] = [
    { word: 'mm0' },
    { word: 'mm1' },
    { word: 'mm2' },
    { word: 'mm3' },
    { word: 'mm4' },
    { word: 'mm5' },
    { word: 'mm6' },
    { word: 'mm7' },
];

export const register_XMM: IReservedWord[] = [
    { word: 'xmm0' },
    { word: 'xmm1' },
    { word: 'xmm2' },
    { word: 'xmm3' },
    { word: 'xmm4' },
    { word: 'xmm5' },
    { word: 'xmm6' },
    { word: 'xmm7' },
    { word: 'xmm8' },
    { word: 'xmm9' },
    { word: 'xmm10' },
    { word: 'xmm11' },
    { word: 'xmm12' },
    { word: 'xmm13' },
    { word: 'xmm14' },
    { word: 'xmm15' },
];

export const register_YMM: IReservedWord[] = [
    { word: 'ymm0' },
    { word: 'ymm1' },
    { word: 'ymm2' },
    { word: 'ymm3' },
    { word: 'ymm4' },
    { word: 'ymm5' },
    { word: 'ymm6' },
    { word: 'ymm7' },
    { word: 'ymm8' },
    { word: 'ymm9' },
    { word: 'ymm10' },
    { word: 'ymm11' },
    { word: 'ymm12' },
    { word: 'ymm13' },
    { word: 'ymm14' },
    { word: 'ymm15' },
];

export const register_SpecialRegister: IReservedWord[] = [
    {word:'cr0'},
    {word:'cr1'},
    {word:'cr2'},
    {word:'dr0'},
    {word:'dr1'},
    {word:'dr2'},
    {word:'dr3'},
    {word:'dr6'},
    {word:'dr7'},
    {word:'tr3'},
    {word:'tr4'},
    {word:'tr5'},
    {word:'tr6'},
    {word:'tr7'},
];

export const register: IReservedWordGroup[] = [
    {
        groupName: '8 bit register',
        casemap: false,
        isUsing: true,
        keywords: register_Byte
    },
    {
        groupName: '16 bit register',
        casemap: false,
        isUsing: true,
        keywords: register_GP_16
    },
    {
        groupName: '32 bit register',
        casemap: false,
        isUsing: true,
        keywords: register_GP_32
    },
    {
        groupName: '64 bit register',
        casemap: false,
        isUsing: true,
        keywords: register_Qword
    },
    {
        groupName: 'Segment register',
        casemap: false,
        isUsing: true,
        keywords: register_Segment
    },
    {
        groupName: 'MMX register',
        casemap: false,
        isUsing: true,
        keywords: register_MMX
    },
    {
        groupName: 'XMM register',
        casemap: false,
        isUsing: true,
        keywords: register_XMM
    },
    {
        groupName: 'YMM register',
        casemap: false,
        isUsing: true,
        keywords: register_YMM
    },
    {
        groupName: 'Special register',
        casemap: false,
        isUsing: true,
        keywords: register_SpecialRegister
    }

];